<!--
 * @Author: luobei luobei@seewintech.com
 * @Date: 2023-02-23 20:43:19
 * @LastEditors: luobei luobei@seewintech.com
 * @LastEditTime: 2023-02-24 15:01:44
 * @FilePath: \ibuilds-web-system\src\views\systemManage\formManage\formDesign\packages\config\input.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div>
    <el-form-item label="占位内容">
      <el-input v-model="data.placeholder" clearable placeholder="占位内容" />
    </el-form-item>
    <el-form-item label="前缀">
      <el-input v-model="data.prepend" clearable placeholder="前缀" />
    </el-form-item>
    <el-form-item label="后缀">
      <el-input v-model="data.append" clearable placeholder="后缀" />
    </el-form-item>
    <el-form-item label="最大长度">
      <el-input-number
        v-model="data.maxlength"
        controls-position="right"
        placeholder="最大长度"
      />
    </el-form-item>
    <el-form-item v-if="data.type != 'password'" label="显示计数">
      <el-switch v-model="data.showWordLimit" />
    </el-form-item>
    <el-form-item v-if="data.type == 'password'" label="显示密码">
      <el-switch v-model="data.showPassword" />
    </el-form-item>
    <el-form-item label="自动数据">
      <el-switch v-model="data.autoData" />
    </el-form-item>
    <!-- 实际联合后端接口 -->
    <!-- <el-form-item v-if="data.autoData" label="接口地址">
      <el-input
        v-model="data.autoDataUrl"
        clearable
        placeholder="请输入接口地址"
      />
    </el-form-item>
    <el-form-item v-if="data.autoData" label="请求方法">
      <el-select
        v-model="data.dicMethod"
        placeholder="请求方法"
        size="small"
        style="width: 100%"
      >
        <el-option label="POST" value="post" />
        <el-option label="GET" value="get" />
      </el-select>
    </el-form-item>
    <el-form-item v-if="data.autoData" label="字段属性">
      <el-input
        v-model="data.autoDataKey"
        clearable
        placeholder="请输入返回数据对应属性"
      />
    </el-form-item> -->
    <!-- 演示用 -->
    <el-form-item v-if="data.autoData" label="字段属性">
      <el-select
        v-model="data.autoDataKey"
        placeholder="请选择字段属性"
        size="small"
        style="width: 100%"
      >
        <el-option
          v-for="(item, index) in autoOptions"
          :key="index"
          :label="item.label"
          :value="item.value"
        />
      </el-select>
    </el-form-item>
  </div>
</template>

<script>
  export default {
    name: 'ConfigInput',
    props: ['data', 'defaultValues'],
    data() {
      return {
        autoOptions: [
          {
            label: '用户名称',
            value: 'userName',
          },
          {
            label: '项目名称',
            value: 'orgName',
          },
          {
            label: '项目编码',
            value: 'projectCode',
          },
          {
            label: '项目经理',
            value: 'fprojectmanager',
          }
        ],
      }
    },
  }
</script>
